package com.welsy.newsmgt.business
{
	import mx.rpc.IResponder;
	import mx.rpc.soap.WebService;
	import mx.rpc.AbstractOperation;
	import mx.rpc.AsyncToken;
	import com.adobe.cairngorm.business.ServiceLocator;
	
	public class GetAllEditingNewsDelegate
	{
		
		private var responder : IResponder;
		private var service : Object;
		
		public function GetAllEditingNewsDelegate(responder : IResponder) {
			this.responder = responder;
			this.service = ServiceLocator.getInstance().getWebService("NewsService") as WebService;
		}
		
		public function getEditingNews(authorId : int) : void {	
			var op : AbstractOperation = service.getOperation("GetAllEditingNews");			
			op.arguments.GetNewsRequest.UserId = authorId;
			
			var token : AsyncToken = service.GetAllEditingNews();
			token.addResponder(responder);
		}
	}
}